package com.qf.feign.factory;

import com.qf.feign.ProviderFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author lixu
 */
@Component
public class ProviderFeignFactory implements FallbackFactory<ProviderFeign>{

    @Override
    public ProviderFeign create(Throwable throwable) {
        //1:Throwable throwable:出现的异常是多少


        //2:
        return new ProviderFeign() {
            @Override
            public String list() {
                return "我是FallbackFactory降级处理list";
            }

            @Override
            public String add() {
                return "我是FallbackFactory降级处理add";
            }
        };
    }
}
